<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>排班表</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <script type="text/javascript">
	
	function excel(){
		var pid=$("#pid").val();
		window.location = "<%=path%>/tmblWorktimeParentController.do?excelTable&id=" + pid;
	}
	function excelMyself(){
		var pid=$("#pid").val();
		var name = $("#name").val();
		window.location = "<%=path%>/tmblWorktimeParentController.do?excelTable&id=" + pid+"&name="+name;
	}
  </script>
  <style type="text/css">
  	.tableA{
  	border-collapse:collapse;
  	
  	}
  	
  	input{
		width: 55px;
		height: 19px;
	}
	td{
		font-size:15px;
		margin-left: 10px;
		text-align: center;
		border: 1px solid black;
	}
	tr{
		
		height: 50px;
	}
  </style>
 </head>
<body>
	<form id="timeTable"  action="" >
	
		<table class="tableA" border="1" cellpadding ="5" cellspacing="10" style="width: 100%;height: 100%;">
			<tr>
			<td > <% for(int i=0;i<29;i++){ %>&nbsp;<%} %></td>	
				<c:forEach items="${daysList }" var="day">
				<td>${day}</td>
				</c:forEach>
			</tr>
			
			<%int i=0; %>
			<%int j=0; %>
<c:forEach items="${wdataList }" var="wd">
<tr >
		<td style="width:20%;">${wd.workPlaceName }</td>
				<c:forEach items="${wd.wtime}" var="data">
				<td>
	            	<input type="hidden" name="wtList[<%=i %>].id" value="${data.id }"/>
	                <input type="hidden" name="wtList[<%=i %>].workplace" value="${data.workplace }"/>
	                <input type="hidden" name="wtList[<%=i %>].workPlaceId" value="${data.workPlaceId }"/>
	                 <input type="hidden" name="wtList[<%=i %>].parentId" value="${data.parentId }"/>
	                 <input type="hidden" name="wtList[<%=i %>].workdate"  value="${data.workdate }"/>
	            	
	            	<input type="hidden" id="cde<%=i %>" name="wtList[<%=i %>].empcdoe" value="${data.empcdoe }"/>
	            	<input type="text" id="<%=i %>" readonly="readonly" name="wtList[<%=i %>].empname" style="height: 25px; font-size:16px;" value="${data.empname }"/>
	             	
	             	<!-- 获取新增的排班信息 -->
	              <c:forEach items="${newdataList}" var="newdata">
	              	<c:if test="${data.workPlaceId==newdata.workPlaceId && data.workdate==newdata.workdate }">
	              	<input type="hidden" name="addWtList[<%=j %>].id" value="${newdata.id }"/>
	                <input type="hidden" name="addWtList[<%=j %>].workplace" value="${newdata.workplace }"/>
	                <input type="hidden" name="addWtList[<%=j %>].workPlaceId" value="${newdata.workPlaceId }"/>
	                 <input type="hidden" name="addWtList[<%=j %>].parentId" value="${newdata.parentId }"/>
	                 <input type="hidden" name="addWtList[<%=j %>].workdate"  value="${newdata.workdate }"/>
	            	
	            	<input type="hidden" id="cde<%=j %>add" name="addWtList[<%=j %>].empcdoe" value="${newdata.empcdoe }"/>
	            	<input type="text" id="<%=j %>add" onclick="selectAppUser('<%=j %>add')" name="addWtList[<%=j %>].empname" style="height: 25px; font-size:16px;" value="${newdata.empname }"/>
	             	
	              	 <%j=j+1; %>
	              	</c:if>
	              	
	              </c:forEach>
	             
	             
	             </td>
	             <%i=i+1; %>
	             </c:forEach>
             
	
</tr>
</c:forEach>	
	
		</table>
	</form>
	<div>
	<c:forEach var="list" items="${tongji}">
		<span style="font-size: 16px;">${list.name} —— ${list.num }</span>
		<span style="font-size: 16px;"> ;</span>
	</c:forEach>
	</div>
		<input id="pid" type="hidden" value="${pId}">
		<input id="name" type="hidden" value="${name}">
		<c:if test="${mess=='showMyself' }">
	   <div style="margin-top: 6px;"><input id="showPrint" type="button" style="width:70px;height: 30px;font-size: 17px;" value="打印" onclick="excelMyself()"/></div>
		</c:if>
		<c:if test="${mess=='show' }">
	   <div style="margin-top: 6px;"><input id="showPrint" type="button" style="width:70px;height: 30px;font-size: 17px;" value="打印" onclick="excel()"/></div>
		</c:if>
		<input type="hidden" id='mess' value="${mess }">
</body>
</html>